﻿using System;
using System.IO;

namespace Base.Core
{
    public class GlobalEnvironment
    {
        /// <summary>
        /// 没有图片时显示的默认图片
        /// </summary>
        public static string NoPicPath { get; } = @"../Resources/noPic.png";
        /// <summary>
        /// 获取存储路径
        /// </summary>
        /// <returns></returns>
        public static string PhotoUrl
        {
            get
            {
                return PhotoStorageUrl;
            }
        }
        /// <summary>
        /// 本地存储路径
        /// </summary>
        public static string PhotoStorageUrl
        {
            get
            {
                string photoStorageUrl = "C:\\ImageSavePath\\";
                try
                {
                    if (!Directory.Exists(photoStorageUrl))
                    {
                        Directory.CreateDirectory(photoStorageUrl);
                    }
                }
                catch (Exception)
                {
                    return string.Empty;
                }
                return photoStorageUrl;
            }
        }
    }
}